package cn.tx.service.impl;

import cn.tx.dao.BaseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Snake Eyes
 * @PROJECT_NAME: hani_parent
 * @DESCRIPTION:
 * @USER: 11647
 * @DATE: 2021/5/31 17:35
 * @Email: 1164763541@qq.com
 */
public class BaseServiceImpl<Q, T> implements BaseDao<Q, T> {
    @Autowired
    protected BaseDao<Q, T> baseDao;

    @Override
    public void insert(T t) {
        baseDao.insert(t);
    }

    @Override
    public T selectByPrimaryKey(Integer id) {
        return baseDao.selectByPrimaryKey(id);
    }

    @Override
    public void deleteByPrimaryKey(Integer id) {
        baseDao.deleteByPrimaryKey(id);
    }

    @Override
    public void updateByPrimaryKeySelective(T t) {
        baseDao.updateByPrimaryKeySelective(t);
    }

    @Override
    public List<T> selectObjectAll() {
        return baseDao.selectObjectAll();
    }

    @Override
    public List<T> selectObjectByCondition(Q q) {
        return baseDao.selectObjectByCondition(q);
    }

    @Override
    public int selectObjectByConditionCount(Q q) {
        return baseDao.selectObjectByConditionCount(q);
    }
}
